repo.or.cz
/
and.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
314 - Robot (BFS)
[and.git]
/
10079 - Pizza Cutting
/
10079.cpp
blob
1ecdc953f82563a80e2a4267538d097db2f00760
1
#include <cstdlib>
2
#include <iostream>
3
4
using namespace
std
;
5
6
int
main
(
int
argc
,
char
*
argv
[])
7
{
8
long long
n
,
max
;
9
cin
>>
n
;
10
while
(
n
>=
0
){
11
if
(
n
%
2
==
0
){
12
max
=
n
/
2
;
13
max
*= (
n
+
1
);
14
max
++;
15
}
else
{
16
max
= (
n
+
1
) /
2
;
17
max
*=
n
;
18
max
++;
19
}
20
cout
<<
max
<<
endl
;
21
cin
>>
n
;
22
}
23
return
0
;
24
}